/*
 * @Author: Quinn
 * @Date: 2023-05-11 22:33:18
 * @LastEditors: quinn
 * @Description:  
 */
import Vue from 'vue'
import VueRouter from 'vue-router'
import extender from './routerExtend'
import { menuRoutes } from './menu'

Vue.use(VueRouter)

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location) {
    return originalPush.call(this, location).catch(err => err)
}

const routes = [
    {
        path: "",
        redirect: "/home",
    },
    ...menuRoutes
]

let router = new VueRouter({
    mode: "hash",
    base: '/',
    routes
})

router = extender(router);

export default router
